package com.jiao.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.jiao.bean.TTrade;
import com.jiao.bean.TTradeQuery;
import com.jiao.dao.TTradeDao;
import com.jiao.service.TTradeService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;


@Service
public class TTradeServiceImpl implements TTradeService {

    @Autowired
    TTradeDao tTradeDao;

    @Override
    public TTrade queryById(Integer id) {
        return tTradeDao.selectByPrimaryKey(id);
    }

    @Override
    public List<TTrade> query(TTradeQuery tTradeQuery) {
        return tTradeDao.selectByExample(tTradeQuery);
    }

    @Override
    public int insert(TTrade tTrade) {
        return tTradeDao.insertSelective(tTrade);
    }

    @Override
    public int update(TTrade tTrade) {
        return tTradeDao.updateByPrimaryKeySelective(tTrade);
    }

    @Override
    public int delete(TTrade tTrade) {
        return tTradeDao.updateByPrimaryKeySelective(tTrade);
    }
}
